title: Starlette JSONResponse into Pydantic parse_obj_as
body: <p>Working with fastapi and having a function that returns created JSONResponse. My goal is to create custom 200 response and put it into Pydantic <code>parse_obj_as</code> with an expected BaseModel.</p>
  <p>Is there a way of getting back the JSONResponse data? Or there any workaround? Thanks!</p>
  <pre><code>from starlette.responses import JSONResponse
  
  
  def func():
      model_id = 0
  
      resp = JSONResponse(
          {&quot;detail&quot;: f&quot;Model {model_id} created&quot;, &quot;HTTPStatusCode&quot;: 200},
         status_code=200,
      )
      return parse_obj_as(&lt;here I need resp data&gt;, MyBaseModel)
  </code></pre>
  <p>BaseModel:</p>
  <pre><code>from pydantic.types import PositiveInt
  from __future__ import annotations, generator_stop
  from pydantic import BaseModel
  
  class MyBaseModel(BaseModel):
      &quot;&quot;&quot;
      Docstring
      &quot;&quot;&quot;
  
      detail: str
      HTTPStatusCode: PositiveInt
  </code></pre>