<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:46:24 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-3818] Bool? on .Net Core 2.1 it is not being bound on .Net Core 3.1 - Unable to cast object of type &apos;MongoDB.Bson.BsonBoolean&apos; to type &apos;MongoDB.Bson.BsonArray&apos;.</title>
                <link>https://jira.mongodb.org/browse/CSHARP-3818</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;I had a project in .Net Core 2.1 that was working fine. One of my classes has a prop like:&lt;/p&gt;

&lt;p&gt;&lt;b&gt;public bool? Terms { get; set; }&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;Was working fine. After I upgraded to .Net Core 3.1, the old items of the collection started to throw&#160; errors when biding to this prop.&lt;/p&gt;

&lt;p&gt;The wierd part is that the new regs created from 3.1, dont throw any error on the bind of this prop.&lt;/p&gt;

&lt;p&gt;The 2.1 reg and the the 3.1 has the same value on MongoDB:&lt;/p&gt;

&lt;p&gt;&quot;Terms&quot; : null&lt;/p&gt;

&lt;p&gt;For the old ones, the error thrown is:&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Unable to cast object of type &apos;MongoDB.Bson.BsonBoolean&apos; to type &apos;MongoDB.Bson.BsonArray&apos;.&lt;/b&gt;&lt;/p&gt;</description>
                <environment>macOS Catalina 10.15.7, Mongo Atlas 4.4.8</environment>
        <key id="1861011">CSHARP-3818</key>
            <summary>Bool? on .Net Core 2.1 it is not being bound on .Net Core 3.1 - Unable to cast object of type &apos;MongoDB.Bson.BsonBoolean&apos; to type &apos;MongoDB.Bson.BsonArray&apos;.</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</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="13202">Works as Designed</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="patrick@boutique-pool.com">Patrick Ferraro</reporter>
                        <labels>
                            <label>triage</label>
                    </labels>
                <created>Thu, 26 Aug 2021 19:07:28 +0000</created>
                <updated>Fri, 27 Oct 2023 13:24:44 +0000</updated>
                            <resolved>Sat, 28 Aug 2021 16:18:19 +0000</resolved>
                                    <version>2.13.1</version>
                                                    <component>BSON</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="4027279" author="JIRAUSER1257742" created="Fri, 27 Aug 2021 18:57:02 +0000"  >&lt;p&gt;Thanks for the update &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=patrick%40boutique-pool.com&quot; class=&quot;user-hover&quot; rel=&quot;patrick@boutique-pool.com&quot;&gt;patrick@boutique-pool.com&lt;/a&gt;, closing this ticket then.&lt;br/&gt;
In this case there is no need for the sample project.&lt;/p&gt;</comment>
                            <comment id="4026959" author="patrick@boutique-pool.com" created="Fri, 27 Aug 2021 17:16:35 +0000"  >&lt;p&gt;Hi Boris, I think it would be better to close this item I&#180;ve opened. I&apos;m sorry, I thought the problem would be the driver, but it&apos;s not. The driver brings the correct information normally, what is causing the problem is when the API project tries to render the object to the controller&apos;s response. I see it&apos;s a serialization issue related to System.Text.Json which is the default library of .Net Core 3.1. I switched to the old NewtonSoft and it worked perfectly.&lt;/p&gt;

&lt;p&gt;Not being a Mongo problem or a driver, do you think it&apos;s necessary for me to send the project that can show this problem?&lt;/p&gt;</comment>
                            <comment id="4025454" author="JIRAUSER1257742" created="Thu, 26 Aug 2021 22:50:29 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=patrick%40boutique-pool.com&quot; class=&quot;user-hover&quot; rel=&quot;patrick@boutique-pool.com&quot;&gt;patrick@boutique-pool.com&lt;/a&gt;&lt;br/&gt;
We have tried to reproduce this behaviour by serializing an object with bool? field in netcoreapp2.1 and reading back in netcoreapp3.1. That worked as expected.&lt;/p&gt;

&lt;p&gt;Could you please provide a simple app reproducing this bug, and a full stack trace?&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="1861001">CSHARP-3817</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </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_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hzjdpz:</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>
                                                                                                                        <customfield id="customfield_11150" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>SERVER fixVersion</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="16441"><![CDATA[4.4]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        </customfields>
    </item>
</channel>
</rss>