It strikes me that there's also a question of whether json::text should translate 'null' like this. I'm inclined to think not, since json is in some sense a domain over text, but it's certainly debatable.
I tend to agree with you here about the semantics of such casts. But consistency and "predictability" of
behaviour for the casts are a bit more important in my view. At least, based on my experience. So, I'm