<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:49:18 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-4767] Automatic known types based on dotnet 7+ JsonDerivedTypeAttribute</title>
                <link>https://jira.mongodb.org/browse/CSHARP-4767</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;Is it possible to implement logic to automatically populate known types based on already defined polymorphism using System.Text.Json.Serialization attributes?&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Simple example that we are using:&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;img src=&quot;https://jira.mongodb.org/secure/attachment/470615/470615_image-2023-08-22-17-15-39-777.png&quot; style=&quot;border: 0px solid black&quot; /&gt;&lt;/span&gt;&lt;/p&gt;</description>
                <environment></environment>
        <key id="2423323">CSHARP-4767</key>
            <summary>Automatic known types based on dotnet 7+ JsonDerivedTypeAttribute</summary>
                <type id="2" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14711&amp;avatarType=issuetype">New Feature</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="12300">Won&apos;t Do</resolution>
                                        <assignee username="james.kovacs@mongodb.com">James Kovacs</assignee>
                                    <reporter username="miroljub.tomic@mydesigns.io">Miroljub Tomic</reporter>
                        <labels>
                    </labels>
                <created>Tue, 22 Aug 2023 15:16:41 +0000</created>
                <updated>Thu, 31 Aug 2023 23:13:14 +0000</updated>
                            <resolved>Thu, 31 Aug 2023 23:13:14 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="5673512" author="james.kovacs" created="Thu, 31 Aug 2023 23:13:02 +0000"  >&lt;p&gt;Hi, &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=miroljub.tomic%40mydesigns.io&quot; class=&quot;user-hover&quot; rel=&quot;miroljub.tomic@mydesigns.io&quot;&gt;miroljub.tomic@mydesigns.io&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;Thank you for your feature suggestion. As you know, the MongoDB .NET/C# Driver provides the &lt;tt&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;BsonKnownTypes&amp;#93;&lt;/span&gt;&lt;/tt&gt; attribute as well as &lt;tt&gt;BsonClassMap&amp;lt;T&amp;gt;.AddKnownType&lt;/tt&gt; for specifying derived classes. We do not support attributes from other frameworks because it would necessitate a dependency on those other frameworks and NuGet packages. If we support &lt;tt&gt;System.Text.Json&lt;/tt&gt; (which Microsoft ships as a separate NuGet package), then we should support &lt;tt&gt;Newtonsoft.Json&lt;/tt&gt;, &lt;tt&gt;ProtoBuf&lt;/tt&gt;, &lt;tt&gt;DataContractSerializer&lt;/tt&gt;, &lt;tt&gt;XmlSerializer&lt;/tt&gt;, and the myriad other data serialization frameworks. This would increase the number of dependencies for all users even if they do not use that particular serialization format.&lt;/p&gt;

&lt;p&gt;Additionally MongoDB&apos;s serialization format is BSON, which is not the same as JSON. BSON uses a binary serialization format and includes richer type support than JSON. Thus examining JSON attributes to configure BSON serialization doesn&apos;t make sense. It is equivalent to examining XML attributes to configure JSON serialization. While it might make sense for your application, it doesn&apos;t make sense in the general case. As well some users may need to intentionally configure their JSON serialization differently than their BSON serialization.&lt;/p&gt;

&lt;p&gt;If using JSON attributes such as &lt;tt&gt;JsonDerivedType&lt;/tt&gt; makes sense for your application, you can include the code snippet that you provided in your application&apos;s bootstrap code.&lt;/p&gt;

&lt;p&gt;I&apos;ve closed this feature suggestion as Won&apos;t Do, but happy to discuss in further comments if you have additional input.&lt;/p&gt;

&lt;p&gt;Sincerely,&lt;br/&gt;
James&lt;/p&gt;</comment>
                            <comment id="5650600" author="dbeng-pm-bot" created="Tue, 22 Aug 2023 15:16:45 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=miroljub.tomic%40mydesigns.io&quot; class=&quot;user-hover&quot; rel=&quot;miroljub.tomic@mydesigns.io&quot;&gt;miroljub.tomic@mydesigns.io&lt;/a&gt;, thank you for reporting this issue! The team will look into it and get back to you soon. &lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="470615" name="image-2023-08-22-17-15-39-777.png" size="39579" author="miroljub.tomic@mydesigns.io" created="Tue, 22 Aug 2023 15:15:40 +0000"/>
                    </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_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|i25cgw:</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>