add polymorphic support to get_object_as_json