[FIX] api: keep related attribute on related fields

Fixes #3231