<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:37:38 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>[GODRIVER-2017] UnmarshalExtJSON with error</title>
                <link>https://jira.mongodb.org/browse/GODRIVER-2017</link>
                <project id="14289" key="GODRIVER">Go Driver</project>
                    <description></description>
                <environment></environment>
        <key id="1737590">GODRIVER-2017</key>
            <summary>UnmarshalExtJSON with error</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</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="13201">Fixed</resolution>
                                        <assignee username="benji.rewis@mongodb.com">Benji Rewis</assignee>
                                    <reporter username="feys1992@gmail.com">&#26480; &#29579;</reporter>
                        <labels>
                    </labels>
                <created>Thu, 20 May 2021 15:56:52 +0000</created>
                <updated>Sat, 28 Oct 2023 11:37:47 +0000</updated>
                            <resolved>Fri, 28 May 2021 20:05:15 +0000</resolved>
                                                    <fixVersion>1.5.3</fixVersion>
                                    <component>JSON &amp;amp; ExtJSON</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="3848456" author="benji.rewis" created="Fri, 28 May 2021 20:05:15 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=feys1992%40gmail.com&quot; class=&quot;user-hover&quot; rel=&quot;feys1992@gmail.com&quot;&gt;feys1992@gmail.com&lt;/a&gt;&#160;this fix is now merged and should available in the next patch of the Go driver.&lt;/p&gt;</comment>
                            <comment id="3848447" author="xgen-internal-githook" created="Fri, 28 May 2021 19:59:14 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Benjamin Rewis&apos;, &apos;email&apos;: &apos;32186188+benjirewis@users.noreply.github.com&apos;, &apos;username&apos;: &apos;benjirewis&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/GODRIVER-2017&quot; title=&quot;UnmarshalExtJSON with error&quot; class=&quot;issue-link&quot; data-issue-key=&quot;GODRIVER-2017&quot;&gt;&lt;del&gt;GODRIVER-2017&lt;/del&gt;&lt;/a&gt; Skip empty extJSON objects correctly in Unmarshal (#677)&lt;br/&gt;
Branch: release/1.5&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/commit/5c6874b17171700111e5c51f943c88e35dd0dee0&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-go-driver/commit/5c6874b17171700111e5c51f943c88e35dd0dee0&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3848446" author="xgen-internal-githook" created="Fri, 28 May 2021 19:57:51 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Benjamin Rewis&apos;, &apos;email&apos;: &apos;32186188+benjirewis@users.noreply.github.com&apos;, &apos;username&apos;: &apos;benjirewis&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/GODRIVER-2017&quot; title=&quot;UnmarshalExtJSON with error&quot; class=&quot;issue-link&quot; data-issue-key=&quot;GODRIVER-2017&quot;&gt;&lt;del&gt;GODRIVER-2017&lt;/del&gt;&lt;/a&gt; Skip empty extJSON objects correctly in Unmarshal (#677)&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/commit/0cd0d3c8e0b1dc249b7638f259d5f9e2a7e7762b&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-go-driver/commit/0cd0d3c8e0b1dc249b7638f259d5f9e2a7e7762b&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3842066" author="benji.rewis" created="Wed, 26 May 2021 16:17:12 +0000"  >&lt;p&gt;Thanks again for the report, &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=feys1992%40gmail.com&quot; class=&quot;user-hover&quot; rel=&quot;feys1992@gmail.com&quot;&gt;feys1992@gmail.com&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;We&apos;ve determined this is a bug. If a field with an empty object (&quot;y&quot; in your case) is undefined in the destination struct and is followed by another object (&quot;rule_group_id&quot; in your case), that following object will be unmarshaled as empty. This was because we were not setting a flag for empty objects back to false when skipping with &lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/blob/master/bson/bsonrw/extjson_reader.go#L162-L174&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;skipObject&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;A fix is in review now: &lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/pull/677&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-go-driver/pull/677&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="3819740" author="benji.rewis" created="Mon, 24 May 2021 20:06:57 +0000"  >&lt;p&gt;Hello &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=feys1992%40gmail.com&quot; class=&quot;user-hover&quot; rel=&quot;feys1992@gmail.com&quot;&gt;feys1992@gmail.com&lt;/a&gt;! Thanks so much for your report; we&apos;re trying to reproduce this error now.&lt;/p&gt;</comment>
                            <comment id="3795234" author="JIRAUSER1256475" created="Thu, 20 May 2021 15:58:36 +0000"  >&lt;p&gt;package mainpackage main&lt;br/&gt;
import ( &quot;testing&quot;&lt;br/&gt;
 &quot;github.com/stretchr/testify/require&quot; &quot;go.mongodb.org/mongo-driver/bson&quot; &quot;go.mongodb.org/mongo-driver/bson/primitive&quot;)&lt;br/&gt;
func TestUnmarshalExtJSON(t *testing.T) { doc := `{&quot;_id&quot;:&lt;/p&gt;
{&quot;$oid&quot;:&quot;5ff5b89ecbc9590001210d5b&quot;}
&lt;p&gt;,&quot;x&quot;:&quot;1006007-154305-18344992668-17136650599&quot;,&quot;y&quot;:{},&quot;z&quot;:0,&quot;rule_group_id&quot;:{&quot;$oid&quot;:&quot;5ff599d4fa3f7f0012d5d3d0&quot;},&quot;m&quot;:&quot;&quot;}`&lt;br/&gt;
 t.Run(&quot;ignore field y&quot;, func(t *testing.T) { foo := struct &lt;/p&gt;
{ ID&#160; &#160; &#160; &#160; &#160; primitive.ObjectID `bson:&quot;_id&quot;` RuleGroupID primitive.ObjectID `bson:&quot;rule_group_id&quot;` }
&lt;p&gt;{} err := bson.UnmarshalExtJSON([]byte(doc), false, &amp;amp;foo) require.NoError(t, err) require.Equal(t, &quot;5ff5b89ecbc9590001210d5b&quot;, foo.ID.Hex()) require.Equal(t, &quot;000000000000000000000000&quot;, foo.RuleGroupID.Hex()) })&lt;br/&gt;
 t.Run(&quot;with field y&quot;, func(t *testing.T) { foo := struct { ID&#160; &#160; &#160; &#160; &#160; primitive.ObjectID `bson:&quot;_id&quot;` RuleGroupID primitive.ObjectID `bson:&quot;rule_group_id&quot;` Y&#160; &#160; &#160; &#160; &#160; &#160;interface{}&#160; &#160; &#160; &#160; `bson:&quot;y&quot;` }{} err := bson.UnmarshalExtJSON([]byte(doc), false, &amp;amp;foo) require.NoError(t, err) require.Equal(t, &quot;5ff5b89ecbc9590001210d5b&quot;, foo.ID.Hex()) require.Equal(t, &quot;5ff599d4fa3f7f0012d5d3d0&quot;, foo.RuleGroupID.Hex()) })}&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_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_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hyz7br:</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>