title: How to write multiple response BaseModel in FastAPI?
body: <p>I want to display multiple response model, so I have defined responses in a file and importing it to main file as below</p>
  <pre><code>@app.post(&quot;/mask&quot;, responses=Example_Mask)
  </code></pre>
  <p>in my <code>response.py</code> I have defined <code>Example_Mask</code> as</p>
  <pre><code>class Example_Mask(BaseModel):
  
      class Config:
          schema_extra = {
              &quot;example&quot;: {
                  &quot;200&quot;: {&quot;model&quot;: Example_200_Mask},
                  &quot;422&quot;: {&quot;model&quot;: Example_422_Mask},
                  &quot;500&quot;: {&quot;model&quot;: Example_500},
                  &quot;504&quot;: {&quot;model&quot;: Example_504}
              }
          }
  </code></pre>
  <p>I have defined all <code>Example</code> models in the same way, but I am getting</p>
  <blockquote>
  <p>TypeError: 'ModelMetaclass' object is not a mapping</p>
  </blockquote>
  <p>error. Can you pls tel me where is this wrong?</p>