JSON serialization for Poly