<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:40:53 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-1868] Deserialize discriminated data to ExpandoObject</title>
                <link>https://jira.mongodb.org/browse/CSHARP-1868</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;I&apos;m trying to deserialize entire document that contains polymorphic collection to dynamic object.&lt;br/&gt;
And I expect that my collection will contain dynamic objects but I&apos;ve got concrete types.&lt;br/&gt;
I&apos;ve created pull request with fix and unit test.&lt;/p&gt;

&lt;p&gt;Example data:&lt;br/&gt;
var json = &quot;{ \&quot;Shapes\&quot; : [&lt;/p&gt;
{ \&quot;_t\&quot; : \&quot;Circle\&quot;, \&quot;Radius\&quot; : 5 }
&lt;p&gt;, &lt;/p&gt;
{ \&quot;_t\&quot; : \&quot;Square\&quot;, \&quot;Side\&quot; : 3 }
&lt;p&gt;] }&quot;;&lt;/p&gt;

&lt;p&gt;Current behavior:&lt;br/&gt;
typeof(Circle) == obj.Shapes&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;.GetType()&lt;br/&gt;
typeof(Square) == obj.Shapes&lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt;.GetType()&lt;/p&gt;

&lt;p&gt;Expected:&lt;br/&gt;
typeof(ExpandoObject) == obj.Shapes&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;.GetType()&lt;br/&gt;
typeof(ExpandoObject) == obj.Shapes&lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt;.GetType()&lt;/p&gt;</description>
                <environment></environment>
        <key id="339086">CSHARP-1868</key>
            <summary>Deserialize discriminated data to ExpandoObject</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</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="13202">Works as Designed</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="anatoliy.rabchevskiy">Anatoliy Rabchevskiy</reporter>
                        <labels>
                    </labels>
                <created>Thu, 15 Dec 2016 14:52:34 +0000</created>
                <updated>Fri, 27 Oct 2023 13:25:11 +0000</updated>
                            <resolved>Mon, 4 Jan 2021 20:17:17 +0000</resolved>
                                    <version>2.3</version>
                                                    <component>Serialization</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="3547692" author="JIRAUSER1257742" created="Mon, 4 Jan 2021 20:12:34 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=anatoliy.rabchevskiy&quot; class=&quot;user-hover&quot; rel=&quot;anatoliy.rabchevskiy&quot;&gt;anatoliy.rabchevskiy&lt;/a&gt;, thank you for your PR.&lt;/p&gt;

&lt;p&gt;Deserializing the discriminated type as a concrete type would be the expected behaviour in most use-cases. Changing this behavior would be a breaking change. However this default behavior can be overridden by a &lt;a href=&quot;http://mongodb.github.io/mongo-csharp-driver/2.11/reference/bson/serialization/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;custom serializer.&lt;/a&gt;&#160;&lt;/p&gt;</comment>
                    </comments>
                    <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_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrax8n:</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>