I see this pattern coming up a lot. Maybe it deserves its own short little function like `tj`. I'm thinking `tjd`, with a comment explaining that it means "to json, with default". Actually, that's a pretty crappy name. Maybe you can come up with something better.