Not sure if this makes sense, but if you can find other classes defining a `toMap()`, consider creating a abstract parent class for them. These classes would be JSON serializable.