schema.compiled: Make sure Invalid are JSON-serializable