It seems that we cant count on serde_json::to_value to detect duplicates, because it swallows them instead of returning an error. The only solution then is to serialize to string and try to deserialize again.