title: How to declare Nullable response types in SwashBuckle (generating clients in NSwagStudio)
body: <p>We use SwashBuckle to configure our AspNet Core (Service fabric) project to generate Swagger json and UI.
  Then we use NSwagStudio to generate typescript and C# clients out of nswag.json template with swagger generated by Swashbuckle.</p>
  <p>Recently there has been changes in latest version of NSwagStudio that generates clients with null checks added to response objects. We have existing Controllers returning null responses so the clients have stopped working.</p>
  <p>Our sample controller endpoint declaration:</p>
  <pre><code>[HttpPost]
  [ODataRoute]
  [Produces(&quot;application/json&quot;)]
  [ProducesResponseType(typeof(IActionResult), Status200OK)]
  public Task PostXXX() =&gt; ...;
  </code></pre>
  <p>Our generated client (before)</p>
  <pre><code>//----------------------
  // &lt;auto-generated&gt;
  //     Generated using the NSwag toolchain v13.6.2.0 (NJsonSchema v10.1.23.0 (Newtonsoft.Json v12.0.0.0)) (http://NSwag.org)
  // &lt;/auto-generated&gt;
  //----------------------
  
  var status_ = ((int)response_.StatusCode).ToString();
  if (status_ == &quot;200&quot;) 
  {
        var objectResponse_ = await ReadObjectResponseAsync&lt;IActionResult&gt;(response_, headers_).ConfigureAwait(false);
        return objectResponse_.Object;
  }
  </code></pre>
  <p>Our generated client (after)</p>
  <pre><code>//----------------------
  // &lt;auto-generated&gt;
  //     Generated using the NSwag toolchain v13.7.0.0 (NJsonSchema v10.1.24.0 (Newtonsoft.Json v12.0.0.0)) (http://NSwag.org)
  // &lt;/auto-generated&gt;
  //----------------------
  
   var status_ = (int)response_.StatusCode;
  if (status_ == 200)
  {
       var objectResponse_ = await ReadObjectResponseAsync&lt;Void&gt;(response_, headers_).ConfigureAwait(false);
       if (objectResponse_.Object == null)
       {
              throw new Exception(&quot;Response was null which was not expected.&quot;, status_, objectResponse_.Text, headers_, null);
       }
       return objectResponse_.Object;
  } 
  </code></pre>
  <p>The question is how do we tell SwashBuckle to mark that this controller endpoint can return nullable response?
  In other words, am looking for something similar to what's available in NSwag here in Swashbuckle world:
  <a href="https://github.com/RicoSuter/NSwag/wiki/AspNetCoreOpenApiDocumentGenerator#response-nullability" rel="nofollow noreferrer">https://github.com/RicoSuter/NSwag/wiki/AspNetCoreOpenApiDocumentGenerator#response-nullability</a></p>
  <p>More details in this github issue
  <a href="https://github.com/RicoSuter/NSwag/issues/3011" rel="nofollow noreferrer">https://github.com/RicoSuter/NSwag/issues/3011</a></p>
  <p>Please let me know if you need more information.</p>