title: "FastAPIError: Invalid args for response field! Hint: check that <class 'typing._UnionGenericAlias'> is a valid pydantic field type"
body: <p>I have the following Pydantic schema for a FastAPI app.</p>
  <p>In the following schema, whenever I have <code>ParameterSchema</code> as the schema validator for <code>params</code>, it gives me the following error:</p>
  <pre><code>fastapi.exceptions.FastAPIError: Invalid args for response field! Hint: check that &lt;class 'typing._GenericAlias'&gt; is a valid pydantic field type
  </code></pre>
  <p>I have no idea what's going on!</p>
  <pre><code>class ParameterSchema(BaseModel):
      expiryDate = Optional[datetime]
  
      class Config:
          arbitrary_types_allowed = True
  
  
  class RequestProvisioningEventData(BaseModel):
      some_attribute: List[str]
      other_attribute: Optional[List[str]] = []
      bool_attribute: bool
      params: ParameterSchema
  
      class Config:
          use_enum_values = True
  </code></pre>