title: Is it possible to somehow initialize pydantic model without knowing the actual field names?
body: <p>I am trying to create some kind of dynamic validation of input-output of a function:</p>
  <pre><code>from pydantic import ValidationError, BaseModel
  import numpy as np
  
  class ValidationImage:
      @classmethod
      def __get_validators__(cls):
          yield cls.validate
  
  
      @classmethod
      def validate(cls, v):
          if not isinstance(v, np.ndarray):
              raise TypeError(&quot;np.ndarray required&quot;)
          return v
  
  
  class TestModel(BaseModel):
      image: ValidationImage
  
  
  def validate(msg, model):
      try:
          message = model(image=msg)
      except ValidationError as e:
          return e
  
  
  testimg = np.zeros([0])
  
  print(validate(testimg, TestModel))
  </code></pre>
  <p>But the problem is that at this point <code>message = model(image=msg)</code> I actually do need to know that there is <code>image</code> field inside the model that I got as an argument of <code>validate</code> function.</p>
  <p>I want to somehow create a model instance without knowing the actual field names(from list maybe?)</p>
  <p>I tried <code>message = model(msg)</code> - doesn't work. I want to know if it's possible to do it? Or are there any workarounds?</p>
  <p>UPDATE #1:
  I was able to get field name by using <code>list(model.__fields__.keys())[0]</code> But I don't know how to use <code>str</code> as actual code. And it seems kinda like a bad practice</p>