title: How can I get OpenApi-Generator to produce nullable DateTimeOffset?
body: <p>My API exposes some endpoints with <code>DateTime?</code> and others with <code>DateTimeOffset?</code>.</p>
  <p>I want to generate an API Client using OpenApi-Generator, that will create client code for each endpoint, respecting the differences between the types.</p>
  <p>OpenApi-Generator offers the option to <code>useDateTimeOffset=true</code>, which will generate the client using <code>DateTimeOffset</code> everywhere regardless of whether the API was exposing <code>DateTime</code> or <code>DateTimeOffset</code>. As such, I don't want to use that.</p>
  <p>So to resolve the requirement without that, I'm attempting to create a Filter in which I will specify that in the case of <code>DateTimeOffset?</code> the generator should use the type <code>DateTimeOffset</code> and make it <code>nullable</code>.</p>
  <p>This is the Filter:</p>
  <pre><code>public class FixDateTimeOffsetTypeSchemaFilter : ISchemaFilter
  {
      public void Apply(OpenApiSchema model, SchemaFilterContext context)
      {
          if (context.Type == typeof(DateTimeOffset?))
          {
              model.Format = &quot;date-time-offset-nullable&quot;;
              model.Type = &quot;DateTimeOffset&quot;; 
              model.Nullable = true;
          }
      }
  }
  </code></pre>
  <p>and this is an example of the output from that:</p>
  <pre><code>&quot;/Api/MyApiEndpoint&quot;: {
    &quot;get&quot;: {
      &quot;tags&quot;: [
        &quot;General&quot;
      ],
      &quot;operationId&quot;: &quot;General_MyApiEndpoint&quot;,
      &quot;parameters&quot;: [
        {
          &quot;name&quot;: &quot;startDatetime&quot;,
          &quot;in&quot;: &quot;query&quot;,
          &quot;schema&quot;: {
            &quot;type&quot;: &quot;DateTimeOffset&quot;,
            &quot;format&quot;: &quot;date-time-offset-nullable&quot;,
            &quot;nullable&quot;: true
          }
        },
  </code></pre>
  <p>When I run this and generate the client from that JSON, the the <code>DateTimeOffset</code> objects are never <code>nullable</code>. It doesn't seem to respect that instruction.</p>
  <p>What do I need to change to make it work, so that when I specify <code>DateTimeOffset</code> should be <code>nullable</code>, it appears as <code>nullable</code> in the code?</p>