title: Show description or comments for variables in FastAPI autodocs (Swagger UI)
body: <p>I'm making a function and class for it with <code>POST</code> method.</p>
  <p>Since I use FastAPI, it automatically generates API docs (using OpenAPI specification and Swagger UI), where I can see the function's description or example data there.</p>
  <p>My class and function are like below:</p>
  <pre class="lang-py prettyprint-override"><code>from pydantic import BaseModel, Field
  from typing import Optional, List
  
  
  @app.post(&quot;/user/item&quot;)
  def func1(args1: User, args2: Item):
      ...
  
  
  class User(BaseModel):
      name: str
      state: List[str]
  
      class Config:
          schema_extra = {
              &quot;example&quot;: {
                  &quot;name&quot;: &quot;Mike&quot;,
                  &quot;state&quot;: [&quot;Texas&quot;, &quot;Arizona&quot;]
              }
          }
  
  
      class Item(BaseModel):
          _id: int = Field(..., example=3, description=&quot;item id&quot;)
  
  
  </code></pre>
  <p>Through <code>schema_extra</code> and <code>example</code> attribute in <code>Field</code>, I can see the example value in <code>Request body</code> of function description.</p>
  <p>It shows like</p>
  <pre><code>{
     &quot;args1&quot;: {
          &quot;name&quot;: &quot;Mike&quot;,
          &quot;state&quot;: [&quot;Texas&quot;, &quot;Arizona&quot;]     # state user visits. &lt;-- I'd like to add this here or in other place.
      },
      &quot;args2: {
          &quot;_id&quot;: 3   &lt;-- Here I can't description 'item id'
      }
  }
  </code></pre>
  <p>However, I'd like to add description or comments to <code>example value</code>, like # state user visits above.</p>
  <p>I've tried to add <code>description</code> attribute of <code>pydantic Field</code>, but I think it shows only for parameters of get method.</p>
  <p>Is there any way to do this? Any help will be appreciated.</p>