title: how to use marshal_with in flask_restful for attributes that can be of different types
body: <p>I'm using flask_restful.marshal_with to sanitize my entities:</p>
  
  <pre><code>class Domain(db.Model):
  
      __tablename__ = 'domain'
  
      id = db.Column(db.BigInteger, primary_key=True)
      domain_name = db.Column(db.String(253), unique=True)
      user_id = db.Column(db.BigInteger, db.ForeignKey('user.id'), nullable=True)
      .... # bunch of other sensitive fields I don't want to output
  </code></pre>
  
  <p>Here's my handler:</p>
  
  <pre><code>class Domains(Resource):
      domain_fields = {
          'id': fields.Integer,
          'user_id': fields.Integer,
          'domain_name': fields.String
          }
  
      @marshal_with(domain_fields)
      def get(self, domain_id):
          """return domain details"""
          entity = domain.Domain.query.get(domain_id)
  
          return entity 
  </code></pre>
  
  <p>The user_id attribute can be either None or an Integer.  </p>
  
  <p>What's a a good say to setup the domain_fields to output either Bool or Int instead of just limited to Int?</p>