<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:48:31 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[CSHARP-4534] Consider adding anonymous types to DefaultAllowedTypes</title>
                <link>https://jira.mongodb.org/browse/CSHARP-4534</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description></description>
                <environment></environment>
        <key id="2268290">CSHARP-4534</key>
            <summary>Consider adding anonymous types to DefaultAllowedTypes</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="10300" iconUrl="https://jira.mongodb.org/images/icons/priorities/medium.svg">Unknown</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="9">Done</resolution>
                                        <assignee username="robert@mongodb.com">Robert Stam</assignee>
                                    <reporter username="boris.dogadov@mongodb.com">Boris Dogadov</reporter>
                        <labels>
                    </labels>
                <created>Sat, 18 Feb 2023 00:28:45 +0000</created>
                <updated>Fri, 21 Jul 2023 23:59:26 +0000</updated>
                            <resolved>Fri, 21 Jul 2023 23:59:26 +0000</resolved>
                                                    <fixVersion>2.21.0</fixVersion>
                                    <component>Serialization</component>
                                        <votes>1</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="5584209" author="xgen-internal-githook" created="Fri, 21 Jul 2023 23:58:36 +0000"  >&lt;p&gt;Author: &lt;/p&gt;
{&apos;name&apos;: &apos;rstam&apos;, &apos;email&apos;: &apos;robert@robertstam.org&apos;, &apos;username&apos;: &apos;rstam&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-4534&quot; title=&quot;Consider adding anonymous types to DefaultAllowedTypes&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-4534&quot;&gt;&lt;del&gt;CSHARP-4534&lt;/del&gt;&lt;/a&gt;: Allow anonymous types in ObjectSerializer.DefaultAllowedTypes.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-csharp-driver/commit/e0c14c80e6c31f337439d2915b5dd90fe38f9562&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-csharp-driver/commit/e0c14c80e6c31f337439d2915b5dd90fe38f9562&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="5561175" author="JIRAUSER1257742" created="Wed, 12 Jul 2023 17:16:13 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=erik.hennerfors%40laget.se&quot; class=&quot;user-hover&quot; rel=&quot;erik.hennerfors@laget.se&quot;&gt;erik.hennerfors@laget.se&lt;/a&gt;&lt;br/&gt;
we are going to reevaluate this ticket, and provide updates here.&lt;/p&gt;

&lt;p&gt;Thanks.&lt;/p&gt;</comment>
                            <comment id="5539909" author="JIRAUSER1272887" created="Mon, 3 Jul 2023 08:52:33 +0000"  >&lt;p&gt;Hi&lt;br/&gt;
Is there any updates for the work on this?&lt;/p&gt;

&lt;p&gt;Kind regards&lt;br/&gt;
Erik&lt;/p&gt;</comment>
                            <comment id="5223901" author="JIRAUSER1272887" created="Thu, 23 Feb 2023 07:28:09 +0000"  >&lt;p&gt;Hi&lt;br/&gt;
I get the decision to add the AllowedTypes filter to the ObjectSerializer, but maybe the solution was hastily implemented. &lt;/p&gt;

&lt;p&gt;One of the strengths, as I see it, of a document database is that you don&apos;t need to type everything. For example, we use MongoDB to store entity audit logs where we have dynamic fields for properties changed on the entity, this is now unusable if we upgrade to 2.19.0&lt;/p&gt;

&lt;p&gt;At least a better example should be provided of how to use dynamic as a property type, since the one we&apos;ve seen being documented does not work.&lt;/p&gt;
&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;var objectSerializer = new ObjectSerializer(type =&amp;gt;&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;    ObjectSerializer.DefaultAllowedTypes(type) ||&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;    type.FullName.StartsWith(&quot;&amp;lt;&amp;gt;f__AnonymousType&quot;));&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;BsonSerializer.RegisterSerializer(objectSerializer);&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;Adding this into for example the `Configure` method in `Startup.cs` will only result in the error &lt;b&gt;BsonSerializationException: There is already a serializer registered for type Object.&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;UPDATE&lt;/b&gt;&lt;br/&gt;
We got the documented solution above wokring by adding it before IHostBuilder, so it is the first thing that are beeing executed in the Main method.&lt;/p&gt;

&lt;p&gt;Kind regards&lt;br/&gt;
Erik&lt;/p&gt;</comment>
                            <comment id="5214967" author="rstam" created="Tue, 21 Feb 2023 00:52:22 +0000"  >&lt;p&gt;The important question to answer is whether this is safe. We don&apos;t want to defeat the security added by &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-4475&quot; title=&quot;Add an AllowedTypes filter to ObjectSerializer&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-4475&quot;&gt;&lt;del&gt;CSHARP-4475&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Most likely an anonymous type can be considered safe for serialization/deserialization if all of its properties are themselves safe for serialization/deserialization.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="2267944">CSHARP-4532</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2225098">CSHARP-4475</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10257" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Documentation Changes</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="11861"><![CDATA[Not Needed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_14266" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Documentation Changes Summary</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>&lt;p&gt;1.  What would you like to communicate to the user about this feature?&lt;br/&gt;
2.  Would you like the user to see examples of the syntax and/or executable code and its output?&lt;br/&gt;
3.  Which versions of the driver/connector does this apply to?&lt;/p&gt;</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr48xi:oas9</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>