<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:14:23 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>[CDRIVER-2168] Escape JSON strings for regex, symbol, and DBPointer types</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-2168</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;When converting BSON to JSON and extended JSON, &lt;tt&gt;bson_utf8_escape_for_json()&lt;/tt&gt; should be used to escape strings for the regex, symbol, and DBPointer types. Escaping is currently done for keys, UTF-8 strings, code (w/ and w/o scope) types.&lt;/p&gt;

&lt;p&gt;Note: escaping regex patterns with &lt;tt&gt;bson_utf8_escape_for_json()&lt;/tt&gt; causes the following BSON corpus test case to fail: &lt;a href=&quot;https://github.com/mongodb/specifications/blob/0fc09a2bc56de5fbee6f9c046083d39b5b62faf2/source/bson-corpus/tests/regex.json#L24&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;regex with slash&lt;/a&gt;. JSON does not require forward slashes to be escaped, so this may mean that &lt;tt&gt;bson_utf8_escape_for_json()&lt;/tt&gt; is too aggressive.&lt;/p&gt;</description>
                <environment></environment>
        <key id="386636">CDRIVER-2168</key>
            <summary>Escape JSON strings for regex, symbol, and DBPointer types</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="13201">Fixed</resolution>
                                        <assignee username="jesse@mongodb.com">A. Jesse Jiryu Davis</assignee>
                                    <reporter username="jmikola@mongodb.com">Jeremy Mikola</reporter>
                        <labels>
                    </labels>
                <created>Wed, 24 May 2017 19:56:26 +0000</created>
                <updated>Sat, 28 Oct 2023 11:30:40 +0000</updated>
                            <resolved>Fri, 16 Jun 2017 17:20:27 +0000</resolved>
                                    <version>1.6.3</version>
                                    <fixVersion>1.7.0</fixVersion>
                                    <component>libbson</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="1670868" author="ramon.fernandez" created="Tue, 12 Sep 2017 18:31:31 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;username&apos;: u&apos;ajdavis&apos;, &apos;name&apos;: u&apos;A. Jesse Jiryu Davis&apos;, &apos;email&apos;: u&apos;jesse@mongodb.com&apos;}
&lt;p&gt;Message:&lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-2168&quot; title=&quot;Escape JSON strings for regex, symbol, and DBPointer types&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-2168&quot;&gt;&lt;del&gt;CDRIVER-2168&lt;/del&gt;&lt;/a&gt; fix JSON UTF-8 escapes&lt;/p&gt;

&lt;p&gt;Don&apos;t escape &quot;/&quot;. Use hex code, not decimal, for u-escapes.&lt;br/&gt;
Branch:master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/libbson/commit/2c030769a3a66168daaa481ed4b4fdc16310e3e9&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/libbson/commit/2c030769a3a66168daaa481ed4b4fdc16310e3e9&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1626777" author="jesse" created="Wed, 19 Jul 2017 20:15:48 +0000"  >&lt;p&gt;Sounds good, seems like it was my oversight.&lt;/p&gt;</comment>
                            <comment id="1626744" author="jmikola@gmail.com" created="Wed, 19 Jul 2017 19:57:40 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=jesse&quot; class=&quot;user-hover&quot; rel=&quot;jesse&quot;&gt;jesse&lt;/a&gt;: I noticed that your commit above never added escaping to the legacy DBPointer function. Since I&apos;m consolidating the canonical/relaxed/legacy encoding in &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-2208&quot; title=&quot;Introduce new API for Extended JSON spec 2.0 output&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-2208&quot;&gt;&lt;del&gt;CDRIVER-2208&lt;/del&gt;&lt;/a&gt;, the collection name for all DBPointer types will now be escaped in JSON.&lt;/p&gt;

&lt;p&gt;I&apos;m not sure if that was an oversight or not, but I thought it worth mentioning the change.&lt;/p&gt;</comment>
                            <comment id="1600103" author="jesse" created="Sun, 18 Jun 2017 01:34:24 +0000"  >&lt;p&gt;Closed in &lt;a href=&quot;https://github.com/mongodb/libbson/commit/2c030769a3a66168daaa481ed4b4fdc16310e3e9&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/libbson/commit/2c030769a3a66168daaa481ed4b4fdc16310e3e9&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1579415" author="david.golden" created="Wed, 24 May 2017 20:36:33 +0000"  >&lt;p&gt;Formally, the RFC says this:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;   A string begins and ends with&lt;br/&gt;
   quotation marks.  All Unicode characters may be placed within the&lt;br/&gt;
   quotation marks, except for the characters that must be escaped:&lt;br/&gt;
   quotation mark, reverse solidus, and the control characters (U+0000&lt;br/&gt;
   through U+001F).&lt;/p&gt;

&lt;p&gt;   Any character may be escaped.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;My view is that &lt;b&gt;testing&lt;/b&gt; extended JSON must account for differences between a driver&apos;s JSON output (whitespace, key order, escaping, etc.) and the valid JSON of the corpus.  One way to do that would be to &quot;wash&quot; the corpus and generated text through a pure JSON decode/encode cycle that also sorts keys.  That&apos;s less meaningful for libbson, which doesn&apos;t have a meaningful intermediate representation.  &lt;/p&gt;</comment>
                            <comment id="1579374" author="jmikola@gmail.com" created="Wed, 24 May 2017 19:58:44 +0000"  >&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/libbson/pull/191&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/libbson/pull/191&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="374688">CDRIVER-2128</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="402667">CDRIVER-2208</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                    <customfield id="customfield_13552" key="com.go2group.jira.plugin.crm:crm_generic_field">
                        <customfieldname>Case</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[[500A000000XLQgvIAH]]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <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|ht01yn:</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>