Concerns About BigInt Serialization and Potential Collisions in New Schema

In the new schema, there’s now a default JSON serialization.
As far as I can tell from the code,
BigInt
values are serialized as numeric strings.
But if my schema is Union(String, BigInt), wouldn’t that cause a collision?
What would it deserialize back into?

So my question is — is this just a theoretical concern, or could this actually cause bugs?
And are there any best practices to avoid this kind of issue?
Was this page helpful?