lib/json/serialization: fix serialization of first attribute