Accessing marshmallow decorators when using flask-marshmallow
<p>I'm using flask-restful, flask-sqlalchemy and flask-marshmallow to build an API service. I define the following -</p>

<pre><code>ma = Marshmallow(app)
</code></pre>

<p>However, trying to access the @validates decorator using ma throws an error.</p>

<pre><code>@ma.validates('field1')
</code></pre>

<p>What am I doing wrong? Is it better to directly use the marshmallow library and skip using flask-marshmallow altogether?</p>

<p>The problem is that you are trying to reach <code>flask-marshmallow</code> decorators in its API, however there is none.</p>

<p>So you to understand if you need <code>flask-marshmallow</code> package, or only <code>marshmallow</code> is required.</p>

<p>Also to make things work, you need to use <a href="http://marshmallow.readthedocs.io/en/latest/api_reference.html#marshmallow.decorators.validates" rel="nofollow"><code>validates()</code></a> decorator as it presented in docs</p>

<pre><code>@validates('field1')
</code></pre>

python flask-restful marshmallow