WP_JSON_Posts::get_post_types() should return array, not hash/object