[FIX] api: keep required attribute on related fields

Fixes #3231