title: pydantic custom data type for phone number : value_error.missing
body: <p>mysql schema for user</p>
  <pre><code>user_id     binary(16) 
  first_name  varchar(32) 
  last_name   varchar(32) 
  email       varchar(255)
  phone       varchar(32) 
  role        enum('member','admin','operator')
  created_on  datetime
  updated_on  datetime
  id   varchar(32)
  </code></pre>
  <p>my pydantic model is</p>
  <pre><code>class UserPatchEntity(BaseModel):
      user_id: Optional[UUID]
      first_name: Optional[str] = Field(min_length=1, max_length=32)
      last_name: Optional[str] = Field(min_length=1, max_length=32)
      email: Optional[EmailStr]
      phone: Optional[Phone]---------------&gt; HERE
      role:  Optional[RoleType]
  </code></pre>
  <p>i want to create a custom datatype for phone number...so i can use it at multiple places....i am trying like below</p>
  <pre><code>class Phone(BaseModel):
      phone: str
      @validator('phone')
      def phone_validation(cls, v):
          phone = v.phone.get(&quot;phone&quot;)
          logger.debug(f&quot;phone in 2 validator:{v}&quot;)
          regex = r&quot;^(\+)[1-9][0-9\-\(\)\.]{9,15}$&quot;
          if v and not re.search(regex, v, re.I):
              raise ValueError(&quot;Phone Number Invalid.&quot;)
          return v
      class Config:
          orm_mode = True
          use_enum_values = True
  </code></pre>
  <p>via postman, i am sending</p>
  <pre><code>{
      &quot;phone&quot;: &quot;+917777777777&quot;
  }
  </code></pre>
  <p>i see 400 error in postman</p>
  <pre><code>[
      {
          &quot;loc&quot;: [
              &quot;phone&quot;,
              &quot;phone&quot;
          ],
          &quot;msg&quot;: &quot;field required&quot;,
          &quot;type&quot;: &quot;value_error.missing&quot;
      }
  ]
  </code></pre>
  <p>Any inputs on what i am doing wrong above</p>