title: FastAPI pydantic.error_wrappers.ValidationError
body: <p>I am using the below model and schema in FastAPI.</p>
  <p>Models</p>
  <pre><code>class Item(Base):
      __tablename__ = &quot;items&quot;
  
      id = Column(Integer, primary_key=True,index=True)
      name = Column(String(80), nullable=False, unique=True,index=True)
      price = Column(Float(precision=2), nullable=False)
      description = Column(String(200))
      store_id =Column(Integer,ForeignKey('stores.id'),nullable=False)
      def __repr__(self):
          return 'ItemModel(name=%s, price=%s,store_id=%s)' % (self.name, self.price,self.store_id)
      
  class Store(Base):
      __tablename__ = &quot;stores&quot;
      id = Column(Integer, primary_key=True,index=True)
      name = Column(String(80), nullable=False, unique=True)
      items = relationship(&quot;Item&quot;,lazy=&quot;dynamic&quot;,primaryjoin=&quot;Store.id == Item.store_id&quot;)
  
      def __repr__(self):
          return 'Store(name=%s)' % self.name
  </code></pre>
  <p>Schemas</p>
  <pre><code>class ItemBase(BaseModel):
      name: str
      price : float
      description: Optional[str] = None
      store_id: int
  
  
  class ItemCreate(ItemBase):
      pass
  
  
  class Item(ItemBase):
      id: int
  
      class Config:
          orm_mode = True
  
  
  class StoreBase(BaseModel):
      name: str
  
  class StoreCreate(StoreBase):
      pass
  
  class Store(StoreBase):
      id: int
      items: List[Item] = []
  
      class Config:
          orm_mode = True
  </code></pre>
  <p>I have created a Store Object in the database. When I am trying to fetch all the stores stored in the database using the below API.</p>
  <pre><code>@app.get('/stores', tags=[&quot;Store&quot;],response_model=List[schemas.Store])
  def get_all_stores(name: Optional[str] = None,db: Session = Depends(get_db)):
      &quot;&quot;&quot;
      Get all the Stores stored in database
      &quot;&quot;&quot;
      if name:
          stores =[]
          db_store = StoreRepo.fetch_by_name(db,name)
          print(db_store)
          stores.append(db_store)
          return stores
      else:
          return StoreRepo.fetch_all(db)
  
  </code></pre>
  <pre><code>[packages]
  fastapi = &quot;==0.68.1&quot;
  uvicorn = &quot;==0.15.0&quot;
  sqlalchemy = &quot;==1.4.23&quot;
  </code></pre>
  <p>I am getting the below exception</p>
  <pre><code>raise ValidationError(errors, field.type_)
  </code></pre>
  <p>pydantic.error_wrappers.ValidationError: 1 validation error for Store
  response -&gt; 0 -&gt; items
  value is not a valid list (type=type_error.list)</p>
  <p>If we remove the response_model=List[schemas.Store] from the API then it works fine.</p>
  <p>Any help will be appreciated.</p>