<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:44:08 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-3020] Nullable Enums not supported</title>
                <link>https://jira.mongodb.org/browse/CSHARP-3020</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;It seems like the C# driver is unable to work with Nullable Enums when I expose the IQueryable of the Collection to Microsoft&apos;s OData libraries.&#160; I&apos;ve tried it with both EnumRepresentationConvention(BSonType.String) as well as BSonType.Int32.&lt;/p&gt;

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

&lt;p&gt;Here is what I&apos;m trying to achieve:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Create API document using Swagger.&lt;/li&gt;
	&lt;li&gt;Generate the controller and models using Swagger Codegen&lt;/li&gt;
	&lt;li&gt;Adjust the controller code to support .NET Core 3.1 (Models are left alone).&lt;/li&gt;
	&lt;li&gt;Add OData support to Startup.cs and controller (&lt;span class=&quot;error&quot;&gt;&amp;#91;EnableQuery()&amp;#93;&lt;/span&gt; and exposing of IQueryable&amp;lt;MyObject&amp;gt;)&lt;/li&gt;
	&lt;li&gt;Try to query using query string &quot;$filter=MyEnumFld eq &apos;enumvalue&apos;&quot;&lt;/li&gt;
&lt;/ol&gt;


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

&lt;p&gt;The above create an error of &quot;InvalidOperationException. (Convert({Document}&lt;/p&gt;
{MyEnumField}
&lt;p&gt;Nullable`1) == 2&quot;.&lt;/p&gt;

&lt;p&gt;Because swagger code gen marks all Enums as nullable (to support PATCHing use-cases I assume), this above error occurs.&#160; When I remove the nullable (question mark) from the model, everything works.&lt;/p&gt;

&lt;p&gt;I&apos;d really like the models to not be touched so that they can be regenerated from a shared swagger doc at any time in the future.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</description>
                <environment>Windows 10 Pro Bld 18363</environment>
        <key id="1286146">CSHARP-3020</key>
            <summary>Nullable Enums not supported</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="13203">Gone away</resolution>
                                        <assignee username="dmitry.lukyanov@mongodb.com">Dmitry Lukyanov</assignee>
                                    <reporter username="mkoziel@gmail.com">Mike Koziel</reporter>
                        <labels>
                    </labels>
                <created>Mon, 23 Mar 2020 15:15:01 +0000</created>
                <updated>Fri, 27 Oct 2023 19:56:08 +0000</updated>
                            <resolved>Mon, 4 May 2020 14:48:18 +0000</resolved>
                                    <version>2.10.2</version>
                                                    <component>Read Operations</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="3037300" author="dmitry.lukyanov" created="Mon, 13 Apr 2020 17:40:30 +0000"  >&lt;p&gt;Hello &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=mkoziel%40gmail.com&quot; class=&quot;user-hover&quot; rel=&quot;mkoziel@gmail.com&quot;&gt;mkoziel@gmail.com&lt;/a&gt;, can you please provide the following:&lt;br/&gt;
1. the structure of `MyObject` and nested objects if they are presented.&lt;br/&gt;
2. the way how you configure this option `EnumRepresentationConvention`.&lt;br/&gt;
3. The full error message.&lt;br/&gt;
4. It will be great if you can try to reproduce this situation without OData with c# driver itself (let me know if you need help with it) and then provide a repro.&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|hwy95b:</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>