title: Marsmhallow ValidationError on _schema - Invalid Input Type
body: <p>I've been trying to figure out what is causing this input type error but can't seem to figure it out.</p>
  <p><strong>models/pin.py</strong></p>
  <pre class="lang-py prettyprint-override"><code>from sqlalchemy import Column, String
  
  
  class Pin(db.Model):
      __tablename__ = 'pin'
  
      pin = Column(String, primary_key=True)
  </code></pre>
  <p><strong>schemas/pin.py</strong></p>
  <pre class="lang-py prettyprint-override"><code>from ..models.pin import Pin
  from marshmallow import fields, validate
  
  
  class PinSchema(ma.Schema):
      pin = fields.Str(required=True, validate=[validate.Length(5)])
  
      class Meta:
          model = Pin
          fields = ('pin')
  
  pin_schema = PinSchema()
  </code></pre>
  <p><strong>resources/pin.py</strong></p>
  <pre class="lang-py prettyprint-override"><code>from flask_restful import Resource
  from flask import request
  from ..schemas.pin import pin_schema
  
  
  class PinResource(Resource):
  
      &quot;&quot;&quot;
          Update current pin
          Expecting:
          {
              'pin': 'current_pin'
              'new_pin': 'new_pin'
          }
      &quot;&quot;&quot;
      def patch(self):
          
          data = request.get_json()
          
          errors = pin_schema.validate(data['new_pin'])
  
          if errors:
              return { &quot;message&quot;: errors }, 400
  
          return { 'tmp': 'tmp' }, 200
  </code></pre>
  <p><strong>Request i'm sending through Postman</strong></p>
  <pre><code>{
      &quot;pin&quot;: &quot;12345&quot;
      &quot;new_pin&quot;: &quot;123456&quot;
  }
  </code></pre>
  <p><strong>The response from server</strong></p>
  <pre><code>{
      &quot;message&quot;: {
          &quot;_schema&quot;: [
              &quot;Invalid input type.&quot;
          ]
      }
  }
  </code></pre>
  <p>I've tried to check the type of <code>new_pin</code> with <code>type(new_pin)</code> and that just returns <code>&lt;class 'str'&gt;</code></p>
  <p>Am I missing something? Shouldn't <code>new_pin</code> pass validation unless it's not castable into a string or shorter than 5 characters?</p>
  <p>I've looked at <a href="https://stackoverflow.com/questions/57953791/validationerror-on-flask-marshmallow-schema">This</a> as this is the only one that I have found that is similar to mine but it doesn't seem to match my case.</p>