title: FastAPI/Redoc created 'openapi.json' is missing 'type' key for Enum params
body: <p>I have a REST API build using FastAPI, with various query string params that are all working fine, generating working <code>openapi.json</code> output:</p>
  <pre class="lang-py prettyprint-override"><code>flagged: bool = False,
  </code></pre>
  <p>Generates:</p>
  <pre><code>{
    &quot;required&quot;: false,
    &quot;schema&quot;: {
      &quot;title&quot;: &quot;Flagged&quot;,
      &quot;type&quot;: &quot;boolean&quot;
    },
    &quot;name&quot;: &quot;flagged&quot;,
    &quot;in&quot;: &quot;query&quot;
  }
  </code></pre>
  <p>However I have some params that use Enum values. The resulting openAPI definition is missing a <code>type</code> specifier -</p>
  <pre class="lang-py prettyprint-override"><code>sortby: TaskSortby = TaskSortby.confusion,
  </code></pre>
  <p>Generates:</p>
  <pre><code> {
    &quot;required&quot;: false,
    &quot;schema&quot;: {
      &quot;allOf&quot;: [
        {
          &quot;$ref&quot;: &quot;#/components/schemas/TaskSortby&quot;
        }
      ],
      &quot;default&quot;: &quot;confusion&quot;
    },
    &quot;name&quot;: &quot;sortby&quot;,
    &quot;in&quot;: &quot;query&quot;
  }
  </code></pre>
  <p>As you can see <code>schema.type</code> is missing, which causes other tools that read <code>openapi.json</code> files to break.</p>
  <p><strong>How can I generate an <code>openapi.json</code> with <code>type</code> key for Enum params?</strong></p>